<?php
namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;

class AuthToken
{
    public function handle($request, Closure $next)
    {
        if (Auth::check()) {
            return $next($request);
        } else {
            //abort(401);
            return response()->json(['code' => 401, 'msg' => '用户未登录或已失效']);
        }
    }
}
